<template>
	<view>
		<view style="height: 24rpx;"></view>
		<mescroll-body ref="mescrollRef" :height="windowHeight+'rpx'" @init="mescrollInit" @down="downCallback"
			@up="upCallback" :up="upOption" :down="downOption">
			<block v-for="(item,index) in list" :key="index">
				<view class="list-public">
					<view class="display-a" style="padding: 36rpx 26rpx;">
						<image class="head" :src="item.head"></image>
						<view style="width: 530rpx;">
							<view class="font-size_30rpx font-weight_bold margin-bottom_20rpx">{{item.nickname}}</view>
							<!-- <view class="color_757575 font-size_26rpx">发布时间 {{selIndex == 1 ? item.createTime : item.ksList.video_info.create_time}}</view> -->
							<view class="color_757575 font-size_26rpx">发布时间 {{item.createTime}}</view>
						</view>
					</view>
					<view class="display-a color_757575 padding-top_20rpx">
						<view class="text-align_center">
							<view class="margin-bottom_10rpx">播放次数</view>
							<!-- <view class="font-weight_bold font-size_30rpx color_22252F">{{selIndex == 1 ? item.viewCount : item.ksList.video_info.view_count}}</view> -->
							<view class="font-weight_bold font-size_30rpx color_22252F">{{item.viewCount}}</view>
						</view>
						<view class="line"></view>
						<view class="text-align_center">
							<view class="margin-bottom_10rpx">点赞次数</view>
							<!-- <view class="font-weight_bold font-size_30rpx color_22252F">{{selIndex == 1 ? item.likeCount : item.ksList.video_info.like_count}}</view> -->
							<view class="font-weight_bold font-size_30rpx color_22252F">{{item.likeCount}}</view>
						</view>
						<view class="line"></view>
						<view class="text-align_center">
							<view class="margin-bottom_10rpx">评论次数</view>
							<!-- <view class="font-weight_bold font-size_30rpx color_22252F">{{selIndex == 1 ? item.commentCount : item.ksList.video_info.comment_count}}</view> -->
							<view class="font-weight_bold font-size_30rpx color_22252F">{{item.commentCount}}</view>
						</view>
						<!-- <view class="line"></view>
						<view class="text-align_center">
							<view class="margin-bottom_10rpx">转发次数</view>
							<view class="font-weight_bold font-size_30rpx color_22252F">{{selIndex == 1 ? item.commentCount : item.ksList.video_info.comment_count}}</view>
						</view> -->
					</view>
				</view>
			</block>
		</mescroll-body>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 下拉配置项
				downOption: {
					auto: false
				},
				// 上拉配置项
				upOption: {
					auto: false
				},
				
				id: '', //所选活动ID
				
				selIndex: '', //1抖音 2视频号 3快手
				
				list: [],
				
				windowHeight: '',
			}
		},
		
		onLoad(options) {
			uni.getSystemInfo({
				success: (res) => {
					this.windowHeight = res.windowHeight * 2 - 28;
				}
			});
			if (options.selIndex) {
				this.selIndex = options.selIndex;
			}
			if (options.id) {
				this.id = options.id;
			}
		},
		
		onShow() {
			this.$nextTick(() => {
				this.mescroll.resetUpScroll();
			});
		},
		
		methods: {
			
			async upCallback(scroll) {
				const result = await this.$http.post({
					url: this.$api.detailsExplosiveStoreCodes,
					data: {
						id: this.id,
						page: scroll.num,
						limit: 10
					}
				});
				if (result.code == 2000) {
					// for (let i = 0 ; i < result.data.list.length ; i++) {
					// 	if (result.data.list[i].ksList.video_info.create_time) {
					// 		result.data.list[i].ksList.video_info.create_time = this.$sun.dateFormat(result.data.list[i].ksList.video_info.create_time,'Y-M-D h:m');
					// 	}
					// }
					this.mescroll.endByPage(result.data.list.length, result.data.count);
					if (scroll.num == 1) this.list = [];
					this.list = this.list.concat(result.data.list);
				}
			},
			
		}
	}
</script>

<style lang="scss">
	
	.line {
		width: 4rpx;
		height: 70rpx;
		border-right: 1px dashed #D9D9D9;
	}
	
	.text-align_center {
		width: 234rpx;
		// width: 174rpx;
		text-align: center;
	}
	
	.head {
		width: 100rpx;
		height: 100rpx;
		border-radius: 100rpx;
		margin-right: 26rpx;
	}
	
	.list-public {
		padding: 30rpx 0;
	}
	
</style>
